package com.xxgc.wujiaolive;

import com.xxgc.wujiaolive.live.LiveConfig;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class WuJiaoLiveApplication {

    public static void main(String[] args) {
        SpringApplication.run(WuJiaoLiveApplication.class, args);
    }

    /**
     * 在启动时去启动直播服务
     */
    @Bean
    public CommandLineRunner startLive(LiveConfig liveConfig){
        return args -> {
            liveConfig.startLive();
        };
    }
}
